package com.agentlab.imitation.service;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.agentlab.imitation.bean.TdYxdhYxdmAll;
import com.agentlab.imitation.bean.TdYxzydmAll;
import com.agentlab.imitation.bean.Zy;
import com.agentlab.imitation.bean.Zydl;
import com.agentlab.imitation.service.base.DaoSupport;

@Service
@Transactional
public class YxdhyxdmServiceBean extends DaoSupport<TdYxdhYxdmAll> implements YxdhyxdmService {
	@Resource
	SessionFactory factory;

	@SuppressWarnings("unchecked")
	@Transactional(propagation = Propagation.NOT_SUPPORTED)
	public void delete(Serializable... entityids) {
		// TODO Auto-generated method stub

	}

	public String getYxmcByYxdm(String yxdm) {
		String yxmc = "";
		List list = factory.getCurrentSession().createQuery(" select distinct yxdmmc from TdYxdhYxdmAll where  yxdm = :yxdm  ").setParameter("yxdm",
				yxdm).list();
		for (Iterator it = list.iterator(); it.hasNext();) {
			Object d = (Object) it.next();
			yxmc = d.toString();
		}
		System.out.println("YxdhyxdmServiceBean.getYxmcByYxdm:yxdm = " + yxdm +",yxmc = " + yxmc);
		return yxmc;
	}

}
